package com.tao.controller.outpatientMedicalTechnologyWorkstation;

import com.tao.common.domain.pojo.CheckApply;
import com.tao.common.enums.EnumCode;
import com.tao.common.utils.ResultUtil;
import com.tao.service.PersonalWorkloadStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: ZJH
 * @Date: 2021/12/24/12:49
 * @Description:
 */
@RestController
@RequestMapping("/outpatientMedicalTechnologyWorkstation/personalWorkloadStatistics")
public class PersonalWorkloadStatisticsController {
    @Autowired
    private PersonalWorkloadStatisticsService service;

    @RequestMapping("/selectAll")
    public ResultUtil selectAll(CheckApply u) {
        System.out.println(u);
        List<CheckApply> list = service.selectAll(u);
        if (list != null) {
            System.out.println("执行了查询语句");
            return new ResultUtil(EnumCode.OK.getValue(), "查询成功", service.selectAll(u));
        }
        return new ResultUtil(EnumCode.UNAUTHORIZED.getValue(), "查询失败");
    }

    @RequestMapping("/selectByID")
    public ResultUtil selectAll() {
        CheckApply res = service.selectByID();
        if (res != null) {
            System.out.println("执行了查询语句");
            return new ResultUtil(EnumCode.OK.getValue(), "刷新成功", service.selectByID());
        }
        return new ResultUtil(EnumCode.UNAUTHORIZED.getValue(), "查询失败");
    }
}
